package com.tqjc.system.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 86195
 * @version 1.0
 * @description 天车枚举
 * @date 2023/10/19 10:03
 */
@Getter
@AllArgsConstructor
public enum CarEnum {

    CAR_NO_1(0,"1号车","1","2"),

    CAR_NO_2(100000,"2号车","2","1");

    private int index;

    private String desc;

    private String carNo;

    private String otherCarNo;

    /**
     * 获取另一台车的枚举
     * @param carEnum
     * @return
     */
    public static CarEnum getAnotherCarEnum(CarEnum carEnum) {
        if(carEnum == null){
            return null;
        }

        if(carEnum.getCarNo().equals(CarEnum.CAR_NO_1.getCarNo())){
            return CAR_NO_2;
        }
        return CAR_NO_1;
    }

    public static CarEnum getCarEnumByCarNo(String carNo){
        if(CarEnum.CAR_NO_1.getCarNo().equals(carNo)){
            return CAR_NO_1;
        }
        return CAR_NO_2;
    }
}
